Sync shapes when dropping elements from table#183
Open
Bisaloo wants to merge 1 commit into
Open
Conversation
HelenaLC
reviewed
May 8, 2026
| s <- shapes(x)[[i]] | ||
| # check which cells still exist | ||
| # FIXME: I kind of doubt this always has this name. Do we have an accessor for this??? | ||
| keep <- s[["__index_level_0__"]] %in% all_nms |
Owner
There was a problem hiding this comment.
Not ideal either, but I know it is sometimes i) missing, or ii) defined by instance_key of the table - maybe we can check for instance_key, and otherwise something like setdiff(names(s), c("radius", "geometry")? At least a little more robust, until we learn better...
Owner
|
Let me talk to Daria/Luca before proceeding. I believe in this particular case, the table is linked to a shape. Said shape, however, misses an instance_key altogether. The column you see should be called "cell_id" imo. I just want to avoid us fixing things when the object is invalid in the first place (not sure yet, but might be)... |
HelenaLC
added a commit
that referenced
this pull request
May 12, 2026
Owner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, SpatialData includes utilities to drop elements from tables when removed from the other layers, but no utilities to drop elements from other layers when elements from tables are dropped.
This is a quick and dirty new
.sync_shapes_on_drop()function, modelled directly after.sync_tables_on_drop()to address a use case needed in demos.Eventually, the
sync...functions should probably be refactored and all cases should be covered, but this should solve the specific issue at hand.